import { FunctionComponent, useState } from "react";
import style from "./index.less";
import { GameAwesomeContainer, IGameProps, GameOver, GameStart } from "./components"
import { navigateTo } from "@/core/RouteService"
import { EGameLev } from "@/enum";

const Game: FunctionComponent = () => {
    const [lev, setLev] = useState<EGameLev>(EGameLev.SIMPLE);
    // 判断是否在游戏中
    const [runInGame, setRunInGame] = useState<boolean>(false);
    const [gameResult, setGameResult] = useState({
        show: false,
        score: 0
    })
    return (
        <div className={style.page}>
            <div className={style.container}>
                {
                    !runInGame ? <GameStart onSelect={(level) => {
                        setLev(level);
                        setRunInGame(true);
                        setGameResult({ score: 0, show: false })
                    }} /> :
                        <>
                            {/* <GameAwesomeContainer level={lev} onFinish={(time) => {
                                setGameResult({ show: true, score: time })
                            }} />
                            <GameOver visible={gameResult.show} score={gameResult.score} onReStart={()=>{
                                setRunInGame(false);
                            }} /> */}
                            <div className={style.container_expect}>敬请期待</div>
                        </>
                }
            </div>
        </div>
    )
}

export default Game;